//Written by Richard Lewis aka Trixmoto (c) 2007

var clipboard = null;
var memory = new Array();
var mempos = -1;

function cutobject() {
  //copy to clipboard
  clipboard = MyProp;
  clipboard.prnt = null;
  
  //remove original
  remobj(MyForm,MyProp);
  
  //refresh display
  MyProp = MyForm;
  storeaction();
  return showview();
}

function copyobject() {
  //copy to clipboard
  clipboard = new cloneobject(MyProp);
  clipboard.prnt = null;
  
  //new name
  switch(clipboard.type) {
    case "act":
      cActivex++;
      clipboard.onam = "Activex"+cActivex;
      break;  
    case "but":
      cButton++;
      if(clipboard.capt==clipboard.onam) {
        clipboard.onam = "Button"+cButton;
        clipboard.capt = "Button"+cButton;
      }
      else {
        clipboard.onam = "Button"+cButton;
      }
      break;      
    case "drp":
      cDropdown++;
      clipboard.onam = "DropDown"+cDropdown;
      break;      
    case "edt":
      cEdit++;
      clipboard.onam = "Edit"+cEdit;
      break;              
    case "chk":
      cCheckbox++;
      clipboard.onam = "CheckBox"+cCheckbox;
      break;    
    case "lbl":
      cLabel++;
      clipboard.onam = "Label"+cLabel;
      break;    
    case "pan":
      cPanel++;
      clipboard.onam = "Panel"+cPanel;
      break;     
    case "rad":
      cRadiobutton++;
      clipboard.onam = "RadioButton"+cRadiobutton;
      break;     
    case "spn":
      cSpinedit++;
      clipboard.onam = "SpinEdit"+cSpinedit;
      break;     
    case "bar":
      cTrackbar++;
      clipboard.onam = "TrackBar"+cTrackbar;
      break;       
    case "tra":
      cTransppanel++;
      clipboard.onam = "TranspPanel"+cTransppanel;
      break;
    default:
      cUnknown++;
      clipboard.onam = "Unknown"+cFUnknown;
  }  
  
  //refresh display
  MyProp = MyForm;
  storeaction();
  return showview();
}

function pasteobject() {
  //add to current
  clipboard.prnt = MyProp;
  MyProp.kids.push(clipboard);
  MyProp = clipboard;
  clipboard = null;
  storeaction();
  return showview();  
}

function storeaction() {
  //!
}

function undo() {
  //!
}

function redo() {
  //!
}

function cloneobject(what) {
  for (i in what) {
    this[i] = what[i];
  }
}

